package cn.cy.behavior.strategy.pattern;

/**
 * @author yangxq
 * @desc
 * @date 2025-05-09
 */
public class PatternClient {

    public static void main(String[] args) {
        PaymentContext context = new PaymentContext();

        context.setStrategy(new CreditCardPayment());
        context.executePayment(100.0); // 使用信用卡支付: 100.0

        context.setStrategy(new AlipayPayment());
        context.executePayment(200.0); // 使用支付宝支付: 200.0

        context.setStrategy(new WeChatPayment());
        context.executePayment(300.0); // 使用微信支付: 300.0
    }

}
